package com.entertainment.ticketing.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class UserRegisterRequest {
    @NotBlank(message = "请输入用户名")
    @Size(min = 3, max = 20, message = "用户名需为3-20位")
    @Pattern(regexp = "^[A-Za-z0-9_]{3,20}$", message = "用户名需为3-20位字母/数字/下划线")
    private String username;

    @NotBlank(message = "请输入邮箱地址")
    @Email(message = "请输入有效的邮箱地址")
    private String email;

    @NotBlank(message = "请输入密码")
    @Size(min = 6, max = 100, message = "密码长度至少6位")
    private String password;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入有效的手机号码")
    private String phone;

    @Size(min = 2, max = 50, message = "姓名至少2个字符")
    private String realName;
}